﻿using System;

namespace Holla.Infrastructure.EventBus
{
    public abstract class IntegrationEvent
    {
        public DateTime CreationDate { get; }

        public string EventType
        {
            get
            {
                return GetType().Name.Replace("IntegrationEvent", string.Empty, StringComparison.InvariantCultureIgnoreCase);
            }
        }

        public Guid Id { get; }

        public string Tag
        {
            get
            {
                return $"{EventType} {Id}";
            }
        }

        protected IntegrationEvent()
        {
            Id = Guid.NewGuid();
            CreationDate = DateTime.UtcNow;
        }
    }
}
